<template>
	<uv-navbar
	  :fixed="false"
	  @leftClick="$onClickLeft"
	  bgColor="#09b4f1"
	>
		<template v-slot:left>
			<uv-icon name="arrow-left" size="19" color="#ffffff"></uv-icon>
		</template>
		<template v-slot:center>
			<text style="color:#ffffff">{{title}}</text>
		</template>
	</uv-navbar>
	<view class="bg-white">
		<uv-cell-group>
			<uv-cell @click="gopage('/pages/components/pages/msg/wait')" :icon="VUE_APP_RESOURCES_URL + '/static/images/16.png'" title="待办事项" label="待办事项消息提现" iconStyle="height:70rpx;width:70rpx;margin-right:10rpx">
				<template v-slot:right-icon>
					<view class="flex align-center">
						<uv-badge type="error" max="99" :value="waitCount"></uv-badge>
						<uv-icon size="30rpx" name="arrow-right"></uv-icon>
					</view>
				</template>
			</uv-cell>
			<uv-cell @click="gopage('/pages/components/pages/msg/exam')" :icon="VUE_APP_RESOURCES_URL + '/static/images/15.png'" title="审批管理" label="审批消息提醒" iconStyle="height:70rpx;width:70rpx;margin-right:10rpx">
				<template v-slot:right-icon>
					<view class="flex align-center">
						<uv-badge type="error" max="99" :value="checkCount"></uv-badge>
						<uv-icon size="30rpx" name="arrow-right"></uv-icon>
					</view>
				</template>
			</uv-cell>
			<uv-cell @click="gopage('/pages/components/pages/mine/list')" :icon="VUE_APP_RESOURCES_URL + '/static/images/23.png'" title="通知管理" label="系统公告通知" iconStyle="height:70rpx;width:70rpx;margin-right:10rpx">
				<template v-slot:right-icon>
					<view class="flex align-center">
						<uv-badge type="error" max="99" :value="noticeCount"></uv-badge>
						<uv-icon size="30rpx" name="arrow-right"></uv-icon>
					</view>
				</template>
			</uv-cell>
		</uv-cell-group>
	</view>
		 
</template>

<script setup>
import {
  ref,
  computed
} from 'vue'
import { useMainStore } from '@/store/store'
import { storeToRefs } from 'pinia'
import { onLoad,onShow} from '@dcloudio/uni-app'
import { VUE_APP_RESOURCES_URL } from "@/config";
const main = useMainStore()
const { indexCount } = storeToRefs(main)
const title = ref('消息')
const cart = ref([])
const uToast = ref()
const waitCount = ref(0)
const checkCount = ref(0)
const noticeCount = ref(0)

onShow(() => {
	noticeCount.value = indexCount.value.brieCountVO.count13
	waitCount.value = indexCount.value.followBusinessCount + indexCount.value.followCluesCount + indexCount.value.followCustomerCount
	checkCount.value = indexCount.value.contractCheckCount + indexCount.value.invoiceCheckCount + indexCount.value.receivablesCheckCount
})

const gopage = (url) => {
	uni.navigateTo({
		url
	})
}

</script>

<style lang="scss" scoped>

</style>
